// 创建路由
import { createBrowserRouter } from "react-router-dom";
import Layout from "@/pages/Layout/index.jsx";
import Login from "@/pages/Login/index.jsx";
import AuthRoute from "@/components/AuthRoute/index.jsx";
import Home from "@/pages/Layout/Home/index.jsx";
import Article from "@/pages/Layout/Artice/index.jsx";
import Publish from "@/pages/Layout/Publish/index.jsx";

const router = createBrowserRouter([
  {
    path: '/',
    element: <AuthRoute><Layout /></AuthRoute>,
    children: [
      {
        path: '',
        element: <Home />,
      },
      {
        path: '/article',
        element: <Article />,
      },
      {
        path: '/publish',
        element: <Publish />,
      },
    ]
  },
  {
    path: '/login',
    element: <Login />
  }
])

export default router;